home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 39 / CD-ROM 39 / CD-ROM 39.iso / COLORDIC / MOUSE / USUARIO.FRM (.txt) < prev   
Encoding:
Visual Basic Form  |  1996-01-21  |  11.8 KB  |  395 lines

  1. VERSION 2.00
  2. Begin Form Usuario 
  3.    BackColor       =   &H0000FFFF&
  4.    ClientHeight    =   3990
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1515
  7.    ClientWidth     =   7365
  8.    ControlBox      =   0   'False
  9.    Height          =   4395
  10.    Left            =   1035
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   266
  15.    ScaleMode       =   3  'Pixel
  16.    ScaleWidth      =   491
  17.    Top             =   1170
  18.    Width           =   7485
  19.    WindowState     =   2  'Maximized
  20.    Begin SSCommand Cancelar 
  21.       Caption         =   "X"
  22.       Enabled         =   0   'False
  23.       FontBold        =   -1  'True
  24.       FontItalic      =   0   'False
  25.       FontName        =   "MS Sans Serif"
  26.       FontSize        =   24
  27.       FontStrikethru  =   0   'False
  28.       FontUnderline   =   0   'False
  29.       Height          =   615
  30.       Left            =   7110
  31.       TabIndex        =   11
  32.       Top             =   6270
  33.       Visible         =   0   'False
  34.       Width           =   1065
  35.    End
  36.    Begin SSCommand OK 
  37.       Caption         =   "OK"
  38.       Enabled         =   0   'False
  39.       FontBold        =   -1  'True
  40.       FontItalic      =   0   'False
  41.       FontName        =   "MS Sans Serif"
  42.       FontSize        =   24
  43.       FontStrikethru  =   0   'False
  44.       FontUnderline   =   0   'False
  45.       Height          =   615
  46.       Left            =   8220
  47.       TabIndex        =   10
  48.       Top             =   6270
  49.       Visible         =   0   'False
  50.       Width           =   1065
  51.    End
  52.    Begin TextBox Nome 
  53.       Height          =   315
  54.       Left            =   7080
  55.       TabIndex        =   0
  56.       Top             =   2730
  57.       Visible         =   0   'False
  58.       Width           =   2175
  59.    End
  60.    Begin PictureBox Picture1 
  61.       AutoSize        =   -1  'True
  62.       BorderStyle     =   0  'None
  63.       FillStyle       =   0  'Solid
  64.       Height          =   1305
  65.       Left            =   150
  66.       ScaleHeight     =   87
  67.       ScaleMode       =   3  'Pixel
  68.       ScaleWidth      =   107
  69.       TabIndex        =   9
  70.       Top             =   120
  71.       Visible         =   0   'False
  72.       Width           =   1605
  73.    End
  74.    Begin Timer Timer1 
  75.       Enabled         =   0   'False
  76.       Interval        =   100
  77.       Left            =   300
  78.       Top             =   2340
  79.    End
  80.    Begin Label Label_Nome 
  81.       BackStyle       =   0  'Transparent
  82.       BorderStyle     =   1  'Fixed Single
  83.       Height          =   315
  84.       Index           =   7
  85.       Left            =   7080
  86.       TabIndex        =   8
  87.       Top             =   5220
  88.       Visible         =   0   'False
  89.       Width           =   2175
  90.    End
  91.    Begin Label Label_Nome 
  92.       BackStyle       =   0  'Transparent
  93.       BorderStyle     =   1  'Fixed Single
  94.       Height          =   315
  95.       Index           =   6
  96.       Left            =   7080
  97.       TabIndex        =   7
  98.       Top             =   4920
  99.       Visible         =   0   'False
  100.       Width           =   2175
  101.    End
  102.    Begin Label Label_Nome 
  103.       BackStyle       =   0  'Transparent
  104.       BorderStyle     =   1  'Fixed Single
  105.       Height          =   315
  106.       Index           =   5
  107.       Left            =   7080
  108.       TabIndex        =   6
  109.       Top             =   4620
  110.       Visible         =   0   'False
  111.       Width           =   2175
  112.    End
  113.    Begin Label Label_Nome 
  114.       BackStyle       =   0  'Transparent
  115.       BorderStyle     =   1  'Fixed Single
  116.       Height          =   315
  117.       Index           =   4
  118.       Left            =   7080
  119.       TabIndex        =   5
  120.       Top             =   4320
  121.       Visible         =   0   'False
  122.       Width           =   2175
  123.    End
  124.    Begin Label Label_Nome 
  125.       BackStyle       =   0  'Transparent
  126.       BorderStyle     =   1  'Fixed Single
  127.       Height          =   315
  128.       Index           =   3
  129.       Left            =   7080
  130.       TabIndex        =   4
  131.       Top             =   4020
  132.       Visible         =   0   'False
  133.       Width           =   2175
  134.    End
  135.    Begin Label Label_Nome 
  136.       BackStyle       =   0  'Transparent
  137.       BorderStyle     =   1  'Fixed Single
  138.       Height          =   315
  139.       Index           =   2
  140.       Left            =   7080
  141.       TabIndex        =   3
  142.       Top             =   3720
  143.       Visible         =   0   'False
  144.       Width           =   2175
  145.    End
  146.    Begin Label Label_Nome 
  147.       BackStyle       =   0  'Transparent
  148.       BorderStyle     =   1  'Fixed Single
  149.       Height          =   315
  150.       Index           =   1
  151.       Left            =   7080
  152.       TabIndex        =   2
  153.       Top             =   3420
  154.       Visible         =   0   'False
  155.       Width           =   2175
  156.    End
  157.    Begin Label Label_Nome 
  158.       BackStyle       =   0  'Transparent
  159.       BorderStyle     =   1  'Fixed Single
  160.       Height          =   315
  161.       Index           =   0
  162.       Left            =   7080
  163.       TabIndex        =   1
  164.       Top             =   3120
  165.       Visible         =   0   'False
  166.       Width           =   2175
  167.    End
  168.    Begin FXImage FXImage1 
  169.       Prop25          =   0  'Click on "..." for About Box
  170.       AutoSize        =   1  'Resize Control To Image
  171.       BInnerColor1    =   &H00808080&
  172.       BInnerColor2    =   &H00FFFFFF&
  173.       BInnerStyle     =   0  'None
  174.       BInnerWidth     =   1
  175.       BorderColor     =   &H00C0C0C0&
  176.       BorderWidth     =   0
  177.       BOuterColor1    =   &H00808080&
  178.       BOuterColor2    =   &H00FFFFFF&
  179.       BOuterStyle     =   0  'None
  180.       BOuterWidth     =   1
  181.       CancelLoad      =   0   'False
  182.       CancelMode      =   0  'None
  183.       CancelRemove    =   0   'False
  184.       Capture         =   0  'None
  185.       CropX           =   0
  186.       CropY           =   0
  187.       DecompressMode  =   1  'Speed more important
  188.       DEffect1        =   0  'No Effect
  189.       DEffect2        =   0  'No Effect
  190.       DEffect3        =   0  'No Effect
  191.       DMode           =   0  'None
  192.       FileName        =   ""
  193.       FXEnabled       =   -1  'True
  194.       GIFPassword     =   ""
  195.       Height          =   7200
  196.       HFileName       =   ""
  197.       Left            =   0
  198.       MDelay          =   30
  199.       MEffect         =   1  'Left To Right
  200.       MGrain          =   10
  201.       Multitask       =   0   'False
  202.       Notify          =   -1  'True
  203.       NotifyDelay     =   0
  204.       Palette         =   0  'Optimized
  205.       Pointer         =   0  'Default
  206.       PointerMode     =   0  'Inside a Hotspot
  207.       ShowDithered    =   1  'Floyd-Steinberg
  208.       ShowFlipped     =   0   'False
  209.       ShowHourglass   =   0   'False
  210.       ShowReverse     =   0   'False
  211.       ShowRotated     =   0  'None
  212.       TBackColor      =   &H00000000&
  213.       TDelay          =   0
  214.       TEffect         =   0  'No Effect
  215.       TEnabled        =   0   'False
  216.       TForeColor      =   &H00000000&
  217.       TGColor1        =   &H00FF0000&
  218.       TGColor2        =   &H00000000&
  219.       TGrain          =   5
  220.       TGSteps         =   16
  221.       TGStyle         =   0  'Left To Right
  222.       TOnly           =   0   'False
  223.       Top             =   0
  224.       Transparent     =   0   'False
  225.       TransparentColor=   &H00000000&
  226.       TransparentMode =   0  'Update
  227.       TStyle          =   0  'Solid
  228.       UpdateImage     =   -1  'True
  229.       Wand            =   0   'False
  230.       WandColor       =   &H00FFFFFF&
  231.       WandWidth       =   1
  232.       Width           =   9600
  233.    End
  234. Dim timer_Contador As Integer
  235. Dim Pr
  236. xima_Cor As Long
  237. Sub Cancelar_Click ()
  238. If Len(Nome) > 0 Then
  239.     a = MsgBox("Deseja apagar o " & Nome & " do programa?", 1, "aten
  240.     If a = 1 Then
  241.         For i = 0 To 7
  242.             If Label_Nome(i).ForeColor = 255 Then
  243.                 Nome = ""
  244.                 Label_Nome(i).Caption = ""
  245.                 Label_Nome(i).ForeColor = &H0
  246.                 deletado = i
  247.                 Exit For
  248.             End If
  249.         Next
  250.         For i = deletado + 1 To 7
  251.             If Len(Label_Nome(i).Caption) > 0 Then
  252.                 Label_Nome(i - 1).Caption = Label_Nome(i).Caption
  253.                 Label_Nome(i).Caption = ""
  254.             Else
  255.                 Exit For
  256.             End If
  257.         Next
  258.         Contador_Usuario = Contador_Usuario - 1
  259.         Grava_Usuario
  260.     End If
  261. End If
  262. End Sub
  263. Sub Form_Load ()
  264. 'carrega a imagem de entrada
  265. FXImage1 = LoadPicture(DIR_TELAS & "entrada1.bmp")
  266. 'carrega os nomes dos Usuarios
  267. On Error GoTo Erro_Usuario
  268. NUsuario = FreeFile
  269. Open DIR_LOCAL & "Usuario.txt" For Input As #NUsuario
  270. Do While Not EOF(NUsuario)
  271.     Line Input #NUsuario, Nome_Var
  272.     Label_Nome(Contador_Usuario).Caption = Left(Nome_Var, Len(Nome_Var) - 4)
  273.     'MsgBox Label_Nome(Contador_Usuario).Caption
  274.     Num_Usuario(Contador_Usuario) = Val(Right(Nome_Var, 4))
  275.     'MsgBox Str(Num_Usuario(Contador_Usuario))
  276.     Contador_Usuario = Contador_Usuario + 1
  277. Close #NUsuario
  278. Carrega_Nome_Desenho
  279. Erro_Usuario:
  280. Carrega_Nome_Desenho
  281. Exit Sub
  282. End Sub
  283. Sub FXImage1_Notify ()
  284. Nome.Visible = True
  285. DoEvents
  286. For i = 0 To 7
  287.     Label_Nome(i).Visible = True
  288. Cancelar.Visible = True
  289. OK.Visible = True
  290. FXImage1.MEffect = 0
  291. Timer1.Enabled = True
  292. End Sub
  293. Sub Grava_Usuario ()
  294. NOut = FreeFile
  295. Open DIR_LOCAL & "usuario.txt" For Output As #NOut
  296. For i = 0 To 7
  297.     If Len(Label_Nome(i).Caption) > 0 Then
  298.         Print #NOut, UCase(Label_Nome(i).Caption) & Mid(Rnd, 2, 4)
  299.     Else
  300.         Exit For
  301.     End If
  302. Close #NOut
  303. End Sub
  304. Sub Label_Nome_Click (index As Integer)
  305. Contador_Usuario = index
  306. Limpa_Forecolor
  307. Label_Nome(index).ForeColor = 255
  308. Nome = Label_Nome(index).Caption
  309. Cancelar.Enabled = True
  310. OK.Enabled = True
  311. Nome.SetFocus
  312. SendKeys "+{end}"
  313. End Sub
  314. Sub Limpa_Forecolor ()
  315. For i = 0 To 7
  316.     Label_Nome(i).ForeColor = &H0
  317. End Sub
  318. Sub Nome_KeyPress (KeyAscii As Integer)
  319. Limpa_Forecolor
  320. Cancelar.Enabled = False
  321. OK.Enabled = False
  322. If KeyAscii = 13 Then
  323.     If Len(Nome) > 0 Then
  324.         Cancelar.Enabled = True
  325.         OK.Enabled = True
  326.         'verifica se j
  327.  existe
  328.         For i = 0 To 7
  329.             If UCase(Nome) = UCase(Label_Nome(i)) Then
  330.                 Label_Nome(i).ForeColor = 255
  331.                 Nome = UCase(Nome)
  332.                 Exit Sub
  333.             End If
  334.         Next
  335.         '... se n
  336. o existe verifica o n
  337. mero m
  338. ximo de Usuarios
  339.         If Contador_Usuario + 1 > 8 Then
  340.             MsgBox "Este programa s
  341.  permite registrar o nome de 8 Usuarios."
  342.             Exit Sub
  343.         End If
  344.         '... se for menor que 8 ...
  345.         Label_Nome(Contador_Usuario).Caption = UCase(Nome)
  346.         Label_Nome(Contador_Usuario).ForeColor = 255
  347.         Nome = UCase(Nome)
  348.         Contador_Usuario = Contador_Usuario + 1
  349.     Else
  350.         MsgBox "Escreva o seu nome."
  351.     End If
  352.     'grava no disco
  353.     Grava_Usuario
  354. End If
  355. Nome.SetFocus
  356. SendKeys "+{end}"
  357. End Sub
  358. Sub OK_Click ()
  359. Timer1.Enabled = False
  360. Dicion
  361. rio.Enabled = True
  362. 'MsgBox DIR_TELAS & Nome_Desenho(Array_Ativo)
  363. Dicion
  364. rio.FXImage1.Picture = LoadPicture(DIR_TELAS & Nome_Desenho(Array_Ativo))
  365. Dicion
  366. rio.Show
  367. End Sub
  368. Sub Timer1_Timer ()
  369. If timer_Contador = 0 Then
  370.     Picture1 = LoadPicture(DIR_TELAS & "moving.bmp")
  371.     Picture1.Visible = True
  372.     timer_Contador = 1
  373.     Timer1.Interval = 200
  374. ElseIf timer_Contador = 1 Then
  375.     Picture1.FillColor = Pr
  376. xima_Cor
  377.     a = floodfill(Picture1.hDC, 15, 47, &H0)
  378.     timer_Contador = 2
  379. ElseIf timer_Contador = 2 Then
  380.     Picture1.FillColor = Pr
  381. xima_Cor
  382.     a = floodfill(Picture1.hDC, 39, 47, &H0)
  383.     timer_Contador = 3
  384. ElseIf timer_Contador = 3 Then
  385.     Picture1.FillColor = Pr
  386. xima_Cor
  387.     a = floodfill(Picture1.hDC, 66, 47, &H0)
  388.     timer_Contador = 1
  389. End If
  390. xima_Cor = RGB(255 * Rnd, 255 * Rnd, 255 * Rnd)
  391. If Pr
  392. xima_Cor = 0 Then Pr
  393. xima_Cor = 1000
  394. End Sub
  395.